package com.example.sikong.feign;


import com.example.sikong.dto.LiveContainerResultDTO;
import com.example.sikong.dto.LiveStartResultDTO;
import com.example.sikong.dto.SiKongResult;
import com.example.sikong.dto.SiKongStartLiveDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "si-kong-client",url = "${si-kong-server-url:https://es-flight-api-cn.djigate.com/}")
public interface SiKongApiClient {

    @PostMapping("manage/api/v1.0/stream-converters")
    SiKongResult<LiveStartResultDTO> startLive(@RequestHeader("X-Organization-Key") String xTokenKey, @RequestBody SiKongStartLiveDTO params);

    @DeleteMapping("manage/api/v1.0/stream-converters/{converter_id}")
    SiKongResult<Object> stopLive(@RequestHeader("X-Organization-Key") String xTokenKey, @PathVariable("converter_id") String converterId);

    @GetMapping("manage/api/v1.0/stream-converters")
    SiKongResult<LiveContainerResultDTO> getLiveContainer(@RequestHeader("X-Organization-Key") String xTokenKey, @RequestParam("channel") String channel);

}
